<?php


namespace app\model;


class User extends BaseModel
{
    protected $hidden = [
        'delete_time', 'password', 'salt'
    ];

    public function validatePassword(String $password)
    {
        return $this->password == md5(md5($password).md5($this->salt));
    }

    public function Hotels(){
        return $this->hasMany(Hotel::class , 'id' , 'user_id');
    }
}